home *** CD-ROM | disk | FTP | other *** search
- /*
- File: LocationManager.h
-
- Contains: LocationManager (manange preferences for different physical locations)
-
- Version: System 7.6
- Package: Location Manager SDK 1.0
-
- Copyright: © 1984-1997 by Apple Computer, Inc.
- All rights reserved.
-
- Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- stack. Include the file and version information (from above)
- in the problem description and send to:
- Internet: apple.bugs@apple.com
-
- */
-
- #ifndef __LOCATIONMANAGER__
- #define __LOCATIONMANAGER__
-
- #ifndef __APPLEEVENTS__
- #include <AppleEvents.h>
- #endif
- #ifndef __COMPONENTS__
- #include <Components.h>
- #endif
- #ifndef __PROCESSES__
- #include <Processes.h>
- #endif
- #ifndef __DIALOGS__
- #include <Dialogs.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- /*
- --------------------------------------------------------------------------------------
- Location token
- --------------------------------------------------------------------------------------
- */
-
- typedef struct OpaqueALMToken* ALMToken;
-
- /*
- --------------------------------------------------------------------------------------
- Public error codes
- --------------------------------------------------------------------------------------
- */
-
- enum {
- ALMInternalErr = -30049,
- ALMLocationNotFound = -30048,
- ALMNoSuchModuleErr = -30047,
- ALMModuleCommunicationErr = -30046,
- ALMDuplicateModuleErr = -30045,
- ALMInstallationErr = -30044,
- ALMDeferSwitchErr = -30043,
- ALMLastErr = ALMDeferSwitchErr,
- ALMLastAllocatedErrNum = -30030
- };
-
- /*
- --------------------------------------------------------------------------------------
- Various parameters
- --------------------------------------------------------------------------------------
- */
-
- /* ALMConfirmName reports these results */
-
- enum {
- ALMConfirmRenameConfig = 1,
- ALMConfirmReplaceConfig = 2
- };
-
- /* ALMSwitchToLocation masks */
-
- enum {
- kALMDefaultSwitchFlags = 0,
- kALMDontShowStatusWindow = 1,
- kALMSignalViaAE = 2
- };
-
- enum {
- kALMLocationNameMaxLen = 31,
- kALMMaxLocations = 16, /* arbitrary limit. enforced by LocatioManager.*/
- kALMNoLocationIndex = -1, /* index and token for the 'off' location*/
- kALMNoLocationToken = -1,
- kAELocationNotice = 'walk', /* Notification AEvent sent to apps when location changes*/
- kALMFileCreator = 'walk' /* creator type of LocatioManager files*/
- };
-
- /* gestalt selectors */
-
- enum {
- gestaltALMVers = 'walk',
- gestaltALMAttr = 'trip',
- gestaltALMPresent = 0
- };
-
- /*
- --------------------------------------------------------------------------------------
- Location-switched notification proc
- --------------------------------------------------------------------------------------
- */
- typedef pascal void (*ALMNotificationProcPtr)(AppleEvent *theEvent);
-
- #if GENERATINGCFM
- typedef UniversalProcPtr ALMNotificationUPP;
- #else
- typedef ALMNotificationProcPtr ALMNotificationUPP;
- #endif
-
- enum {
- uppALMNotificationProcInfo = kPascalStackBased
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(AppleEvent *)))
- };
-
- #if GENERATINGCFM
- #define NewALMNotificationProc(userRoutine) \
- (ALMNotificationUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppALMNotificationProcInfo, GetCurrentArchitecture())
- #else
- #define NewALMNotificationProc(userRoutine) \
- ((ALMNotificationUPP) (userRoutine))
- #endif
-
- #if GENERATINGCFM
- #define CallALMNotificationProc(userRoutine, theEvent) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppALMNotificationProcInfo, (theEvent))
- #else
- #define CallALMNotificationProc(userRoutine, theEvent) \
- (*(userRoutine))((theEvent))
- #endif
-
- /*
- --------------------------------------------------------------------------------------
- Dispatched trap API
- --------------------------------------------------------------------------------------
- */
- extern pascal OSErr ALMGetCurrentLocation(SInt16 *index, ALMToken *token, Str31 name)
- THREEWORDINLINE(0x303C, 0x0600, 0xAAA4);
-
- extern pascal OSErr ALMGetIndLocation(SInt16 index, ALMToken *token, Str31 name)
- THREEWORDINLINE(0x303C, 0x0501, 0xAAA4);
-
- extern pascal OSErr ALMCountLocations(SInt16 *nLocations)
- THREEWORDINLINE(0x303C, 0x0202, 0xAAA4);
-
- extern pascal OSErr ALMSwitchToLocation(ALMToken newLocation, SInt32 switchFlags)
- THREEWORDINLINE(0x303C, 0x0403, 0xAAA4);
-
- extern pascal OSErr ALMRegisterNotifyProc(ALMNotificationUPP notificationProc, const ProcessSerialNumber *whichPSN)
- THREEWORDINLINE(0x303C, 0x0404, 0xAAA4);
-
- extern pascal OSErr ALMRemoveNotifyProc(ALMNotificationUPP notificationProc, const ProcessSerialNumber *whichPSN)
- THREEWORDINLINE(0x303C, 0x0405, 0xAAA4);
-
- extern pascal OSErr ALMConfirmName(ConstStr255Param msg, Str255 configName, SInt16 *choice, ModalFilterUPP filter)
- THREEWORDINLINE(0x303C, 0x0806, 0xAAA4);
-
- /*
- --------------------------------------------------------------------------------------
- Location Manager User Module API
- --------------------------------------------------------------------------------------
- */
-
- enum {
- kALMComponentType = 'walk', /* These masks apply to the "flags" field in the ComponentDescription record. */
- kALMMultiplePerLocation = 1, /* this module can be added more than once to a location */
- /* this module's settings' descriptions can change even */
- kALMDescriptionGetsStale = 2 /* when the setting didn't change. */
- };
-
- typedef UInt32 ALMComponentFlagsEnum;
- typedef UInt32 ALMRebootFlags;
-
- enum {
- /* These are the possible values of ALMRebootFlags to be returned in the 'flags' parameter of ALMSetCurrent() */
- kALMNoChange = 0,
- kALMAvailableNow = 1,
- kALMFinderRestart = 2,
- kALMProcesses = 3,
- kALMExtensions = 4,
- kALMWarmBoot = 5,
- kALMColdBoot = 6,
- kALMShutdown = 7
- };
-
- enum {
- kALMScriptInfoVersion = 2
- };
-
- struct ALMScriptMgrInfo {
- SInt16 version; /* set to kALMScriptInfoVersion */
- SInt16 scriptCode;
- SInt16 regionCode;
- SInt16 langCode;
- SInt16 fontNum;
- SInt16 fontSize;
- };
- typedef struct ALMScriptMgrInfo ALMScriptMgrInfo;
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __LOCATIONMANAGER__ */
-
-